<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #d1{
            height: 200px;
            border: 1px solid red;
            cursor: crosshair;
        }
    </style>
    <script>
//        window.onload = inti;
/*        function fn(e) {
            //查找id法
           /!* var obj = document.getElementById('d1');
            alert(obj.value);*!/
           var obj = e.target; //事件源
           alert(obj.value);}*/
        //鼠标移动侦测
        function fn(e) {
            var obj = document.getElementById('d1');
            var x = e.clientX;
            var y = e.clientY;
            obj.innerHTML = "坐标"+x+','+y;
        }
    </script>
</head>
<body>
<!--<input type="button" value="点击1" id="d1" onclick="fn(event)">
<input type="button" value="点击2" id="d1" onclick="fn(event)">
<input type="button" value="点击3" id="d1" onclick="fn(event)">
<input type="button" value="点击4" id="d1" onclick="fn(event)">
<input type="button" value="点击5" id="d1" onclick="fn(event)">
<input type="button" value="点击6" id="d1" onclick="fn(event)">
<input type="button" value="点击7" id="d1" onclick="fn(event)">-->
<div id="d1" onmousemove="fn(event)">
    坐标0,0
</div>
</body>
</html>